﻿
using System;
using System.IO;
using System.Windows;
using System.Windows.Resources;
namespace KouDai.Phone.Helper
{
    public class StorageHelper
    {
        /// <summary>
        /// 读取本地的json字符串
        /// </summary>
        /// <param name="fileName">文件名称</param>
        /// <returns></returns>
        public static string ReadFileFromLocalJson(string fileName)
        {
            Uri uri = new Uri("LocalJson/" + fileName, UriKind.RelativeOrAbsolute);
            StreamResourceInfo sri = Application.GetResourceStream(uri);
            using (StreamReader reader = new StreamReader(sri.Stream))
            {
                return reader.ReadToEnd();
            }
        }
    }
}
